home *** CD-ROM | disk | FTP | other *** search
- /*
- File: CContentReader.h
-
- Contains: xxx put contents here xxx
-
- Written by: Tim Harnett
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <5> 2/6/95 TMH made protected what was private
- <4> 1/13/95 TMH removed use of MailHandler
- <3> 1/11/95 TMH added nested letter functions, and tweak to generalize framework
- <2> 11/2/94 JHB Adding support for Sending eWorld Mail
- <1> 9/20/94 TMH Abandon RoadsideRest embrace Mercury
- <2> 9/9/94 TMH TIncoming/TOutgoing adaptations
- 6/17/94 TMH xxx put comment here xxx
-
- To Do:
- */
-
- #ifndef __CContentReader__
- #define __CContentReader__
-
- class TOutgoingXLetter;
- class TOutgoingALetter;
-
- #ifndef __OCE__
- #include "OCE.h"
- #endif
-
- #ifndef __OCEMESSAGING__
- #include "OCEMessaging.h"
- #endif
-
- #ifndef __OCEMAIL__
- #include "OCEMail.h"
- #endif
-
-
- //------------------------------------------
- // C C o n t e n t R e a d e r
- //------------------------------------------
-
-
- #define kReadBlockSize 500
- class CContentReader {
-
- public:
- CContentReader(MailMsgRef msgRef);
-
- OSErr ReadContentBlock();
-
- virtual OSErr ReadContent(TOutgoingXLetter* outgoingXLetter);
- virtual OSErr ReadContent(TOutgoingALetter* outgoingALetter);
-
- OSErr InventoryContent();
-
- Boolean SegmentType() { return fPB.segmentType; }
- long SegmentLength() { return fPB.segmentLength; }
-
- Boolean MoreSegmentContent() { return (!fPB.endOfSegment && !fPB.endOfContent && fOSErr == 0); }
- Boolean MoreContent() { return (fOSErr==0) && !fPB.endOfContent; }
-
-
- void* CurrentBlock() { return (void*) fPB.buffer.buffer; }
- unsigned long CurrentBlockSize() { return fPB.buffer.dataSize; }
-
-
-
- Boolean HasText() { return fTextLength!=0; }
- Boolean HasStyledText() { return fStyledTextLength!=0; }
- Boolean HasSound() { return fSoundLength!=0; }
- Boolean HasMovie() { return fMovieLength!=0; }
- Boolean HasPict() { return fPictLength!=0; }
- Boolean HasContent() { return ( HasText() | HasSound() | HasMovie() | HasPict() ); }
-
- long TextLength() { return fTextLength; }
- long StyledTextLength() { return fStyledTextLength; }
- long SoundLength() { return fSoundLength; }
- long MovieLength() { return fMovieLength; }
- long PictLength() { return fPictLength; }
- long ContentLength() { return fTextLength+fSoundLength+fMovieLength+fPictLength; }
-
- protected:
-
- long fTextLength;
- long fStyledTextLength;
- long fSoundLength;
- long fMovieLength;
- long fPictLength;
-
- long fNTextSegments;
- long fNStyledTextSegments;
- long fNSoundSegments;
- long fNMovieSegments;
- long fNPictSegments;
-
- MSAMGetContentPB fPB;
- OSErr fOSErr;
- char fContentReadBuf[kReadBlockSize];
-
- };
-
-
-
- #endif __CContentReader__
-